/*package Examples;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Vector;

import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

public class Schedule extends javax.swing.JFrame {
	private Connection con;
	private String session = null;



	public Schedule(Main main, String flag) {
		initComponents();

		this.con = main.con;
		if(flag.equals("addSubject"))
			session = main.session;

		schedTable.addMouseListener(new MouseAdapter() {
			public void mousePressed(MouseEvent e){
				int row = schedTable.rowAtPoint(e.getPoint());
				int col = schedTable.columnAtPoint(e.getPoint());
				System.out.println("Row = " + row + " Column = " + col);                    
			}

		});
		initComponents();

	}

	private void display(int yr){
		try {
			DefaultTableModel model = (DefaultTableModel) schedTable.getModel();            

			int ctr = 0;

			while(ctr < model.getRowCount()){
				model.removeRow(ctr);
			}

			PreparedStatement stmt = con.prepareStatement("select * from APP.SCHEDULE where yr=" + yr);
			ResultSet sched = stmt.executeQuery();

			while(sched.next()){
				PreparedStatement stmt2 = con.prepareStatement("select * from APP.SUBJECT where subjectNumber='" + sched.getString("subjectNum") + "'");
				ResultSet subj = stmt2.executeQuery();
				subj.next();

				Vector vec = new Vector();
				vec.add(sched.getInt("numOfStud"));
				vec.add(subj.getString("name"));
				vec.add(subj.getInt("unit"));
				vec.add(sched.getString("day") + " " + sched.getString("startTime") + " - " + sched.getString("endTime"));
				vec.add(sched.getString("room"));
				vec.add(sched.getInt("yr"));

				model.addRow(vec);                    

			}


		} catch (SQLException ex) {
			JOptionPane.showMessageDialog(null, ex);
		}

	}
	*//** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 *//*
	@SuppressWarnings("unchecked")
	private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
		display(1);
	}                                        

	private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
		display(2);
	}                                        

	private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                         
		display(3);

	}                                        

	private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {                                         
		display(4);  
	}                                        

	*//**
	 * @param args the command line arguments
	 *//*
	public static void main(String args[]) {
		java.awt.EventQueue.invokeLater(new Runnable() {

			public void run() {
				new Schedule(new Main(), null).setVisible(true);
			}
		});
	} 
	private void initComponents() {

		jLayeredPane1 = new javax.swing.JLayeredPane();
		jScrollPane1 = new javax.swing.JScrollPane();
		schedTable = new javax.swing.JTable();
		jLabel2 = new javax.swing.JLabel();
		jButton1 = new javax.swing.JButton();
		jButton2 = new javax.swing.JButton();
		jButton3 = new javax.swing.JButton();
		jButton4 = new javax.swing.JButton();
		jButton5 = new javax.swing.JButton();
		jComboBox1 = new javax.swing.JComboBox();
		jButton6 = new javax.swing.JButton();
		jLabel1 = new javax.swing.JLabel();
	}
}*/